﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data;

namespace TrabalhoIA.DAO
{
    public class Execute
    {
        private OleDbConnection conn = Connection.getCurrentConn();

        protected String query;
        public DataSet executeQuery()
        {
            try
            {

                OleDbCommand command = conn.CreateCommand();
                command.CommandText = query;
                OleDbDataAdapter da = new OleDbDataAdapter(command);
                DataSet ds = new DataSet();
                da.Fill(ds);
                conn.Close();
                return ds;
                

            }
            catch (Exception)
            {
                
                throw;
            }
        }

    }
}
